
//type 1右边 2左边
export const getTemplateCard = (res, user, imgUrl) => {
	console.log('getTemplateCard', res)
	console.log('imgUrl', imgUrl)
	if (res.type == 1) {
		return {
			css: {
				// 根节点若无尺寸，自动获取父级节点
				width: '690rpx',
				height: '380rpx',
				//borderRadius: '30rpx'
			},
			views: [
				//底图
				{
					type: 'image',
					src: res.Template_img,
					//src: ossUrl + '/template/card/1/模板.png',
					//src: ossUrl + '/template/card/1/封面.png',
					css: {
						width: '100%',
						height: '380rpx',
						top: "0",
						right: "0",
						position: "absolute",
						zIndex: '5',
						// borderRadius: '30rpx'
					}
				},
				//头像
				{
					type: 'image',
					src: imgUrl,
					//src: ossUrl + '/template/card/1/模板.png',
					//src: ossUrl + '/template/card/1/封面.png',
					css: {

						height: '380rpx',
						top: "0",
						right: "0",
						position: "absolute",
						zIndex: "1",
						// borderRadius: '30rpx',
						objectFit: 'contain'
					}
				},
				//基本信息
				{
					css: {
						height: "200rpx",
						width: "340rpx",
						top: "20rpx",
						left: "20rpx",
						position: "absolute",
						zIndex: "9"
					},
					views: [
						//邮箱
						{
							css: {
								height: "",
								width: "100%",
								display: "flex",
								padding: "10rpx 10rpx 0",
								boxSizing: "border-box",
								marginBottm: "0rpx",
								display: user.mailbox ? '' : 'none'
							},
							views: [
								{
									type: 'image',
									src: res.mailbox_img,
									css: {
										width: '30rpx',
										height: '30rpx'
									}
								},
								{
									type: 'text',
									text: user.mailbox,
									css: {
										// 设置右对齐
										textAlign: 'left',
										lineClamp: 1,
										flex: '1',
										paddingLeft: '15rpx',
										fontSize: '22rpx',
										fontWeight: 'bold',
										color: res.contact_color
									}
								},
							],
							type: "view"
						},
						//手机
						{
							css: {

								height: "",
								width: "100%",
								display: "flex",
								padding: "10rpx 10rpx 0",
								boxSizing: "border-box",
								marginBottm: "0rpx",
								display: user.mobile ? '' : 'none'
							},
							views: [{
									type: 'image',
									src: res.phone_img,
									css: {
										width: '30rpx',
										height: '30rpx'
									}
								},
								{
									type: 'text',
									text: user.mobile,
									css: {
										// 设置右对齐
										textAlign: 'left',
										lineClamp: 1,
										flex: '1',

										paddingLeft: '15rpx',
										fontSize: '22rpx',
										fontWeight: 'bold',
										color: res.contact_color
									}
								},
							],
							type: "view"
						},
						//微信
						{
							css: {

								height: "",
								width: "100%",
								display: "flex",
								padding: "10rpx 10rpx 0",
								boxSizing: "border-box",
								marginBottm: "0rpx",
								display: user.wechat_number ? '' : 'none'
							},
							views: [{
									type: 'image',
									src: res.we_chat_img,
									css: {
										width: '30rpx',
										height: '30rpx'
									}
								},
								{
									type: 'text',
									text: user.wechat_number,
									css: {
										// 设置右对齐
										textAlign: 'left',
										lineClamp: 1,
										flex: '1',

										paddingLeft: '15rpx',
										fontSize: '22rpx',
										fontWeight: 'bold',
										color: res.contact_color
									}
								},
							],
							type: "view"
						},
						//地址
						{
							css: {

								height: "",
								width: "100%",
								padding: "10rpx 10rpx 0",
								boxSizing: "border-box",
								marginBottm: "0rpx",
								display: user.company ? '' : 'none'
							},
							views: [{
									type: 'image',
									src: res.address_img,
									css: {
										width: '30rpx',
										height: '30rpx'
									}
								},
								{
									type: 'text',
									text: user.company,
									css: {
										width: '235rpx',
										// 设置右对齐
										textAlign: 'left',
										lineClamp: 2,
										flex: '1',
										paddingTop: '3rpx',
										paddingLeft: '15rpx',
										fontSize: '22rpx',
										fontWeight: 'bold',
										lineHeight: '25rpx',
										color: res.contact_color
									}
								},
							],
							type: "view"
						}
					],
					type: "view"
				},
				// 基础用法
				{
					css: {

						height: "200rpx",
						width: "360rpx",
						top: "225rpx",
						left: "20rpx",
						position: "absolute",
						zIndex: "9"
					},
					views: [
						{
							type: 'text',
							text: user.nickname,
							css: {
								// 设置右对齐
								textAlign: 'left',
								lineClamp: 1,
								paddingLeft: '15rpx',
								fontSize: '65rpx',
								width: '100%',
								color: res.name_color,
								display: user.nickname ? '' : 'none'
							}
						},
						{
							type: 'text',
							text: user.name,
							css: {
								// 设置右对齐
								textAlign: 'left',
								lineClamp: 1,
								paddingLeft: '15rpx',
								fontSize: '28rpx',
								fontWeight: 'bold',
								width: '100%',
								color: res.Identity_color,
								display: user.name ? '' : 'none'
							}
						},
					],
					type: "view"
				},
			]
		}
	} else if (res.type == 2) {
		return {
			css: {
				// 根节点若无尺寸，自动获取父级节点
				width: '690rpx',
				height: '380rpx',
				//borderRadius: '30rpx'
			},
			views: [
				//底图
				{
					type: 'image',
					src: res.Template_img,
					//src: ossUrl + '/template/card/2/模板.png',
					// /src: ossUrl + '/template/card/2/封面.png',
					//src: ossUrl + '/template/card/2/布局02.png',
					css: {
						width: '100%',
						height: '380rpx',
						top: "0",
						right: "0",
						position: "absolute",
						zIndex: '5',
						//borderRadius: '30rpx'
					}
				},
				//头像
				{
					type: 'image',
					src: imgUrl,
					//src: ossUrl + '/template/card/1/模板.png',
					//src: ossUrl + '/template/card/1/封面.png',
					css: {
						width: '200rpx',
						height: '200rpx',
						top: "50rpx",
						left: "48rpx",
						position: "absolute",
						zIndex: "1",
						objectFit: 'fill',

					}
				},
				//基本信息
				{
					css: {
						// height: "200rpx",
						width: "300rpx",
						top: "65rpx",
						right: "20rpx",
						position: "absolute",
						zIndex: "9"
					},
					views: [
						//邮箱
						{
							css: {

								height: "",
								width: "100%",
								display: "flex",
								padding: "10rpx 10rpx 0",
								boxSizing: "border-box",
								marginBottom: "25rpx",
								display: user.mailbox ? '' : 'none'
							},
							views: [{
									type: 'image',
									src: res.mailbox_img,
									css: {
										width: '30rpx',
										height: '30rpx'
									}
								},
								{
									type: 'text',
									text: user.mailbox,
									css: {
										// 设置右对齐
										textAlign: 'left',
										lineClamp: 1,
										flex: '1',

										paddingLeft: '15rpx',
										fontSize: '22rpx',
										fontWeight: 'bold',
										color: res.contact_color
									}
								},
							],
							type: "view"
						},
						{
							css: {

								height: "",
								width: "100%",
								display: "flex",
								padding: "10rpx 10rpx 0",
								boxSizing: "border-box",
								marginBottom: "25rpx",
								display: user.mobile ? '' : 'none'
							},
							views: [{
									type: 'image',
									src: res.phone_img,
									css: {
										width: '30rpx',
										height: '30rpx'
									}
								},
								{
									type: 'text',
									text: user.mobile,
									css: {
										// 设置右对齐
										textAlign: 'left',
										lineClamp: 1,
										flex: '1',

										paddingLeft: '15rpx',
										fontSize: '22rpx',
										fontWeight: 'bold',
										color: res.contact_color
									}
								},
							],
							type: "view"
						},
						{
							css: {

								height: "",
								width: "100%",
								display: "flex",
								padding: "10rpx 10rpx 0",
								boxSizing: "border-box",
								marginBottom: "25rpx",
								display: user.wechat_number ? '' : 'none'
							},
							views: [{
									type: 'image',
									src: res.we_chat_img,
									css: {
										width: '30rpx',
										height: '30rpx'
									}
								},
								{
									type: 'text',
									text: user.wechat_number,
									css: {
										// 设置右对齐
										textAlign: 'left',
										lineClamp: 1,
										flex: '1',

										paddingLeft: '15rpx',
										fontSize: '22rpx',
										fontWeight: 'bold',
										color: res.contact_color
									}
								},
							],
							type: "view"
						},
						{
							css: {

								height: "",
								width: "100%",
								padding: "10rpx 10rpx 0",
								boxSizing: "border-box",
								marginBottom: "20rpx",
								display: user.company ? '' : 'none',
							},
							views: [{
									type: 'image',
									src: res.address_img,
									css: {
										width: '30rpx',
										height: '30rpx'
									}
								},
								{
									type: 'text',
									text: user.company,
									css: {
										paddingTop: '3rpx',
										width: '235rpx',
										// 设置右对齐
										textAlign: 'left',
										lineClamp: 2,
										paddingLeft: '15rpx',
										fontSize: '22rpx',
										fontWeight: 'bold',
										lineHeight: '30rpx',
										color: res.contact_color
									}
								}
							],
							type: "view"
						}
					],
					type: "view"
				},
				// 基础用法
				{
					css: {
						width: '248rpx',
						height: '100rpx',
						top: "250rpx",
						left: "0",
						position: "absolute",
						zIndex: "9"
					},
					views: [{
							type: 'text',
							text: user.nickname,
							css: {
								// 设置右对齐
								lineClamp: 1,
								width: '100%',
								textAlign: 'right',
								fontSize: '55rpx',
								width: '100%',
								color: res.name_color,
								display: user.nickname ? '' : 'none'
							}
						},
						{
							type: 'text',
							text: '中级教练',
							css: {
								// 设置右对齐
								lineClamp: 1,
								width: '100%',
								textAlign: 'right',
								fontSize: '26rpx',
								fontWeight: 'bold',
								width: '100%',
								color: res.Identity_color,
								display: user.name ? '' : 'none'
							}
						},
					],
					type: "view"
				},
			]
		}
	}
	return {}
}
export const templateCard = [


]